1. Field of the Invention
The present invention relates to a language processing field, and more particularly, a method, a computer system and a computer program for generating a parser combination (also called a hybrid parser) by combining at least two language processing parsers.
2. Related Art
In language processing, a syntax analyzer (parser) is used for analyzing the grammatical structure of a language. There are two main types of parsers, a natural language processing parser (also referred to as an np parser (an NLP parser), below) and a formal language processing parser (also referred to as an fp parser (a parser for formal grammar), below).
The natural language processing parser is a parser for interpreting natural sentences. Natural sentences are also called natural language text. Natural language text is a symbol system which has been developed naturally with cultural backgrounds and is used for everyday communication by humans.
The formal language processing parser, on the other hand, is a parser which is suitable for interpreting text including formal sentences. A formal sentence is a term used in contrast to a natural sentence or natural language text. Formal sentences are artificially defined sentences, such as a project deliverable document, a software specification, a document including a formula or a programming language, or the like. Examples of a project deliverable document include a requirements specification, a design specification and a technical specification.
A technique has been known which automatically generates a parser combination from declarative description data (also simply referred to as a declarative description, below) by combining language processing parsers. This technique is represented by a parser generator and a parser combinatory library, for example. Examples of a parser generator include Yacc (Yet Another Compiler-Compiler), ANTLR (Another Tool for Language Recognition), CPUS and Java (registered trademark) CC (Java (registered trademark) Compiler Compiler).
Examples of a parser combinatory library include Parsec (parallax of one arcsecond), JParsec and Scala standard library. These days, with the wide spread of tools such as Yacc, it has become possible to automatically generate a parser, in other words, to output source code of a program of a parser, simply by writing grammar.
In addition, an approach has been known in which a combination of patterns that cannot be declaratively described, e.g., a combination of a formal language processing parser and a parser for a different type processing (natural language processing, for example), is newly programmed every time when needed. This is because combining a natural language processing parser and a formal language processing parser is impossible by the conventional methods since the natural language processing parser and the formal language processing parser are different in characteristics.
Japanese Patent Application Publication No. Sho 63-138465 describes the following technique. In this technique, an inputted Japanese sentence is analyzed morphologically, a judgment is made on whether there is only one syntactic rule applicable to a part of a result of the morphological analysis, the syntactic rule is applied to the morphological analysis result in accordance with an output deriving from the judgment, and a morpheme string obtained as a result of the application is analyzed syntactically (Means for Solving the Problems).